#!/usr/bin/wish

proc push_button {} {
	    put_text
	    .main see end
}

proc put_text {} {
	set f [ open "| date" r]
	while {[gets $f x] >= 0} {
		    .main insert end "$x\n"
	}
	catch {close $f}
}

button .but -text "Push Me" -command "push_button"
text .main -relief sunken -bd 2 -yscrollcommand ".scroll set"
scrollbar .scroll -command ".main yview"

pack .but
pack .main -side left -fill y
pack .scroll -side right -fill y
